function debounce(func,delay){
    let timer;
    return function(...args){
        if(timer){
            clearTimeout(timer);
        }
        timer=setTimeout(()=>{
            func.apply(this,args);
            timer=null;
        },delay)
    }
}
export default debounce;